Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix usage of FIBERSTATUS VARIABLETHRU #2337

Merged
merged 2 commits into from
Aug 23, 2024
Merged

fix usage of FIBERSTATUS VARIABLETHRU #2337

merged 2 commits into from
Aug 23, 2024

Conversation

sbailey
Copy link
Contributor

@sbailey sbailey commented Aug 23, 2024

This PR fixes the usage of FIBERSTATUS bit VARIABLETHRU. Putting it into desispec.fiberbitmasking for kind=sky and stdstars was not correct; that not only excludes it from being used for sky and stdstars, but also masks out the entire fiber with ivar=0 when applying sky subtraction. This PR removes that bit from fiberbitmasking and moves the logic into desispec.sky.get_sky_fibers and desispec.fluxcalib.isStdStar.

I tested the preservation of ivar>0 with

cd /global/cfs/cdirs/desi/spectro/redux/k1/exposures/20230612/00185028
desi_process_exposure -i frame-z9-00185028.fits.gz \
  --fiberflat fiberflatexp-z9-00185028.fits.gz \
  --sky sky-z9-00185028.fits.gz \
  --calib fluxcalib-z9-00185028.fits.gz \
  -o $SCRATCH/cframe-z9-00185028.fits

With main, this results in fiber 4891 having frame.ivar=0 and frame.mask=BADFIBER; with this PR it has frame.fibermap['FIBERSTATUS']=VARIABLETHRU but keeps ivar>0 and frame.mask=0.

@sbailey
Copy link
Contributor Author

sbailey commented Aug 23, 2024

I also verified this by running tile 24782 night 20230612 through all steps of the pipeline:

 srun -N 1 -n 64 -c 2 --cpu-bind=cores desi_mps_wrapper desi_proc_tilenight -n 20230612 -t 24782 --mpi --cameras a0123456789 --mpistdstars --laststeps="all,fluxcalib,skysub"
srun -N 1 -n 64 -c 2 --gpu-bind=map_gpu:3,2,1,0 --cpu-bind=cores desi_zproc -t 24782 -g cumulative -n 20230612 -e 185028 -c a0123456789 --mpi --run-zmtl --max-gpuprocs 4 --starttime $(date +%s)

outputs in $CFS/desi/users/sjbailey/spectro/redux/k2 . for z7, the zframe, spectra, and coadd files all have (COADD_)FIBERSTATUS VARIABLETHRU set for fiber 4891 (good), but the spectra aren't masked (good) and are successfully redshifted (good).

@sbailey sbailey merged commit 41f987a into main Aug 23, 2024
26 checks passed
@sbailey sbailey deleted the variablethru branch August 23, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant